<?php
session_start(); 
include('../mysql.php');
include('../functions.php');
include('../conf.php');
$suc	=	FALSE;
if(isset($_SESSION['_user'])){
	$admin	=	$_SESSION['_user'];
	$q	=	mysql_query("SELECT * FROM thanhvien WHERE `t_user`='".$admin['username']."' AND `t_pass`='".$admin['password']."' AND t_level=1");
	$row	=	mysql_num_rows($q);
	if($row ==1){
		$suc	=	TRUE;
	}
}

if($suc ===	FALSE){
	header("Location: login.php");exit;
}
include('header.php');

?>

<?php 
	$act	=	(isset($_GET['act']) ? $_GET['act'] : 'home');
	$page	=	$act.'.php';
	$page	=	(file_exists($page) ? $page : 'home.php');
	include($page);
?>

<?php 
include('footer.php');
?>